Release 10.1A: OpenEdge Development:
Programming Interfaces
Coding the 4GL program
The 4GL program:
- Assumes that the C program creates and connects the named pipe.
- Refers to the named pipe using the name the C program specifies.
- Uses the
INPUTFROMstatement to read the named pipe.- Uses the
OUTPUTTOstatements to write the named pipe.- Uses the
INPUTCLOSEandOUTPUTCLOSEstatements to close the named pipe.The following 4GL program demonstrates reading and writing a Windows named pipe "custpipe:"
As you can see:
- The program defines three buttons, labeled “Write to Pipe,” “Read from Pipe,” and “Quit.”
- The program defines a form to contain the buttons.
- The program defines a trigger for the Write to Pipe button. The trigger redirects output to named pipe
custpipe, displays (to named pipecustpipe) the name of each customer in the Sports database, and closes the named pipe.In an
OUTPUT TOstatement,\\.means the current machine. To communicate with remote machine “pcdev68,” for example, use\\pcdev68. This follows Uniform Naming Conventions (UNC).The
OUTPUT TOstatement uses theAPPENDoption, which causes Progress to open the named pipe without first creating it. This is necessary because Progress 4GL cannot create named pipes.- The program defines a trigger for the Read to Pipe button. The trigger defines an integer data item, reads named pipe
custpipe, assigns the value read (a customer number) to the integer data item, closes the named pipe, retrieves the row of the customer table with the specified customer number, and displays the columns of the row.The
INPUT FROMstatement assumes that the pipe exists and that another process writes to it. TheINPUT FROMstatement blocks until the other process writes to the named pipe.- The program defines a trigger for the Quit button.
- The program enables all objects in the frame and waits on a close event.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |